<ul id="messages">
    {% for message in messages %}
        <li {% if message.tags %} class="{{ message.tags }}"{% endif %}
                                  id="message-{{ message.pk }}">
            {{ message.message|safe }}
            {% if message.is_persistent %}
                <a class="message_read" href="{% url message_mark_closed message.pk %}">
                    <div class="message_close"></div>
                </a>
            {% else %}
                <div class="temp_message_close"></div>
            {% endif %}
        </li>
    {% endfor %}
</ul>